home *** CD-ROM | disk | FTP | other *** search
/ Champak Vol C-14 / Vol C-14.iso / games / sheepsho.swf / scripts / frame_253 / DoAction.as
Text File  |  2012-04-23  |  2KB  |  56 lines

  1. setProperty("/cross", _visible, 0);
  2. marginerror = garfieldscale * 0.7;
  3. garfieldtempx = garfieldx;
  4. garfieldtempy = garfieldy;
  5. garminx = garfieldx - marginerror;
  6. garmaxx = garfieldx + marginerror;
  7. garminy = garfieldy - marginerror / 2;
  8. garmaxy = garfieldy + marginerror / 2;
  9. if(buttonmovie2.hitTest(_root["obstacle" + _root.choose].hitarea) and hitobsok == 1)
  10. {
  11.    setProperty("/hitpoof", _visible, 1);
  12.    setProperty("/buttonmovie2", _visible, 0);
  13.    setProperty("/hitpoof", _X, obstaclex);
  14.    setProperty("/hitpoof", _Y, 224);
  15.    setProperty("/hitpoof", _xscale, 75);
  16.    setProperty("/hitpoof", _yscale, 75);
  17.    hitobsok = 0;
  18.    tellTarget("/hitpoof")
  19.    {
  20.       gotoAndPlay(2);
  21.    }
  22.    tellTarget("_root.obstacle" + _root.choose)
  23.    {
  24.       gotoAndPlay(1);
  25.    }
  26. }
  27. else if(crossx >= garminx and crossx <= garmaxx and crossy >= garminy and crossy <= garmaxy)
  28. {
  29.    hit = "Hit";
  30.    setProperty("/hitpoof", _visible, 1);
  31.    setProperty("/buttonmovie2", _visible, 0);
  32.    setProperty("/hitpoof", _X, tempx);
  33.    setProperty("/hitpoof", _Y, tempy);
  34.    setProperty("/hitpoof", _xscale, scalemovie);
  35.    setProperty("/hitpoof", _yscale, scalemovie);
  36.    tellTarget("/hitpoof")
  37.    {
  38.       gotoAndPlay(2);
  39.    }
  40.    score += 1;
  41. }
  42. else
  43. {
  44.    hit = "Miss";
  45.    setProperty("/sheepfall", _visible, 1);
  46.    setProperty("/buttonmovie2", _visible, 0);
  47.    setProperty("/sheepfall", _X, tempx);
  48.    setProperty("/sheepfall", _Y, tempy);
  49.    setProperty("/sheepfall", _xscale, scalemovie);
  50.    setProperty("/sheepfall", _yscale, scalemovie);
  51.    tellTarget("/sheepfall")
  52.    {
  53.       gotoAndPlay(2);
  54.    }
  55. }
  56.